#include "Camera.h"

Camera::Camera(const vec3& pos, const vec3& tar, const vec3& worldUp)
{
   this->pos = pos;
   this->worldUp = normalize(worldUp);
   this->forward = normalize(tar - pos);
   this->right = normalize(cross(forward, worldUp));
   this->up = normalize(cross(right, forward));
}

mat4 Camera::GetViewMatrix()
{
   return lookAt(pos, pos + forward, worldUp);
}
